# -!- coding: utf-8 -!-
'''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
 存放api接口信息。以dict形式存放，这样就可以API_ALL[''][url]这种方式去取，看起来较直观，知道取得是哪个接口的那部分信息
'''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''

from datetime import datetime
import json

annual_income = {
    "200000以上": "200000以上",
    "100000-200000": "100000-200000",
    "50000-100000": "50000-100000",
    "10000-50000": "10000-50000",
    "10000以下": "100000-200000",
}

work_time = {
    "1年以下": "1年以下",
    "1年": "1年",
    "2年": "2年",
    "3-4年": "3-4年",
    "5-7年": "5-7年",
    "8-9年": "8-9年",
    "10年以上": "10年以上"
}

contact_relation = {
    "coworker": "同事",
    "mother": "母亲",
    "father": "父亲",
    "other_relative": "其他亲属",
    "friend": "朋友",
    "spouse": "配偶",
    "others": "其他",
    "child": "其他"
}

occupation = {
    "BEGINNERS": "初级、助理人员",
    "JUNIOR": "基层管理人员",
    "SENIOR ": "高层管理人员",
    "OTHERS": "其它",
    "PRACTICE": "见习专员",
    "MIDDLE": "中层管理人员",
    "INTERMEDIATES": "中级技术人员",
    "NORMAL": "普通员工",
    "ADVANCED": "高级资深人员",
}

blackList_type = {
    "Phone": "客户手机号",
    "IdCard": "客户身份证",
    "RelativeContact": "直系联系人电话",
    "Deviceid": "设备ID",
    "BankCard": "客户银行卡",
    "EmpName": "单位名称",
    "EmpTel": "单位电话",
    "HomeTel": "家庭电话",
    "OtherContact": "其他联系人电话",
}

# 接出接口
API_RISK = {
    "Tencent" : "https://csec.api.qcloud.com/v2/index.php?Action=AntiFraud&Nonce=1570196305&Region=gz&SecretId=AKIDz81enfpbgV7XbUKSaS5Vfiax5YYNhEHA&Signature=3W5gGRz4y5Tbcv2zSMkYRkY5cqQ%3D&Timestamp=1569273016"
                "&idNumber=430702198202043015&name=%E9%BE%9A%E7%BE%A4%E7%A7%91&phoneNumber=15907367626",
    
    "tongDun":{
        "biz_code": "yqdqweb",                                          # 业务流编号 优钱网页
        "id_number": "123123123123123000",    # 必填
        "account_mobile": "13113131313",      # 必填
        "account_name": "张三",               # 必填
        "account_phone": "0571-42331233",
        "account_email": "212121212@qq.com",
        "card_number": "6333380402564890000",
        "registered_address": "浙江省杭州市西湖区古荡新村2幢101",          # 户籍地址
        "contact_address": "浙江省杭州市西湖区古荡新村2幢101",             # 通讯地址
        "home_address": "浙江省杭州市西湖区古荡新村2幢101",                # 家庭地址
        "house_property": "有房",
        "house_type": "商品房",
        "annual_income": "100000-200000",
        "monthly_income": "12000以上",
        "work_time": "1年以下",
        "diploma": "研究生",
        "career": "半专业人员",
        "occupation": "见习专员",
        "applyer_type": "在职",
        "work_phone": "0571-111111111",
        "company_type": "私营",
        "industry": "金融业",
        "company_address": "test",
        "organization": "阿里巴巴西溪园区",                              # 借款人工作单位
        "organization_address": "浙江省杭州市阿里巴巴西溪园区",            # 工作单位地址
        "token_id": "test",
        "ip_address": "test",
        "event_occur_time": "2016-03-01 08:16:30",
        "device_id": "test",
        "resp_detail_type": "test",                                    # 归属地详情类型
        "black_box": "test",
        "marriage": "未婚",
        "qq_number": "313131313",
        "loan_date": "2015-11-19",
        "customer_channel": "test",                                      # 获客渠道
        "apply_province": "四川",
        "loan_term": "12",
        "loan_amount": "10000",
        "loan_purpose": "车贷",
        "is_cross_loan": "否",                                            # 是否曾跨平台借款
        "surety_id_number": "321282333333333333",
        "surety_name": "刘能",
        "surety_company_address": "浙江省杭州市下城区潮王路18号",
        "surety_home_address": "浙江省杭州市西湖区古荡新村",
        "surety_phone": "0571-222222222",
        "surety_mobile": "15223456789",
        "coborrower_id_number": "321282555555555555",
        "coborrower_name": "王五",
        "coborrower_home_address": "浙江省杭州市西湖区古荡新村2幢201",   # 共同借款人公司地址
        "coborrower_company_address": "杭州市江干区2号大街928号",
        "coborrower_mobile": "17012345678",
        "coborrower_phone": "0571-10101010",
        "contacts_address": [{
            "contact1_id_number": "test",
            "contact1_mobile": "test",
            "contact1_name": "test",
            "contact1_relation": "test"
            },
            {
            "contact2_id_number": "test",
            "contact2_mobile": "test",
            "contact2_name": "test",
            "contact2_relation": "test"
            },
            {
            "contact3_id_number": "test",
            "contact3_mobile": "test",
            "contact3_name": "test",
            "contact3_relation": "test"
            }
        ],
    },

    "talking": {
        "businessSceneId":"bl241554c0680e4199aabf92c04be06ddd",
        "eventTime":"1569312944326",
        "phone":"13975286537",
        "riskServiceVersion":"1.0"
    },

    # 电话邦--邦信分快捷版接口GET 方式
    "phoneState":"date=20190923&authCode=11wq222saq&name=哈哈&tel=13202480788&idnum=510802199410284112&products=[251,257,277]&encrpyt=1",
    # date非必填时查当天日期，products非必填时返回所有开通字段结果

    # 验证风险策略接口request
    "bairong_infoverify":{
        "apiName":"https://api.100credit.cn/infoverify/v1/info_verify",
        "reqData":{
            "cell":"15907367626",
            "conf_id":"MCP0027021",
            "id":"430702198202043015",
            "name":"龚群科"
        },
        "tokenid":"gzmsStr_486BF0E832C856D8131B4C7CDB98E15B"
    },

    # 融360身份证OCR识别request
    "idCardOcr":{
        "method": "tianji.api.faceplus.idcardocr",
        "sign_type": "RSA",                              # 签名方式，目前仅支持RSA
        "format": "json",
        "sign": "v5SV5HzP4jo5U0u8/H/xB04wcTltRfjjKVIvY70IR6aGvyUHfi2HE7ZS5Ded3YR4WcTkW7YhWdd3YaDzNh11CO6frxdDyh2OW3mi5RMW1XXexfO7Z8B8U0FcwRykPhM8K3Jspe+qq/2dppHLad0zOl3pa29De+hpLSPqEaBYFWs=",
        # biz_data: 请求的业务数据，此处数据格式为Json封装  有image(身份证照片base64编码，图片大小不超过2M),legality(返回身份证照片合法性检查结果，值只取“0”或“1”。“1”：返回； “0”：不返回。默认“0”。)
        "biz_data": "{\"image\":\"/9j/4AAQSkZJRgABAQEASABIAAD/iMzwWunkBFFHD/FLQLdKqqY/CtxiIv3xT/AGoBd6alSoCpjwGw+JVt1MR2PHFYvock9NYK5vsf5mlSqdz}",
        "app_id": "2010713",
        "version": "1.0",
        "timestamp": "1565834874574"
    },

    # 融360FACE++识别request
    "r360Face":{},

    # 天创信用request
    "tianchuang":{
        "aviationReport":{
            "processNo": "tc" + datetime.now().strftime('%Y%m%d%H%M%S'),
            "sysCode": "APPSERVER",
            "productCode":"h5",
            "idCard": "44018219961104003X",
            "passport":None,                  # 非必填
            "month":"12"                      # 分析时间段，⼏个⽉内，可选3、6、12
        },
        "railwayReport":{
            "processNo": "tc" + datetime.now().strftime('%Y%m%d%H%M%S'),
            "sysCode": "APPSERVER",
            "productCode":"h5",
            "name": "梁家龙",                # 非必填
            "idCard": "452226199407166311",
            "type":"ST",
            "parameter":None                # 根据请求类型输⼊
        },
        "consumingProbe":{
            "processNo": "tc" + datetime.now().strftime('%Y%m%d%H%M%S'),
            "sysCode": "APPSERVER",
            "productCode":"h5",
            "phone": "18576783787",
            "name": "梁家龙",
            "idNumber": "452226199407166311"
        },
        "consumptionVariables":{
            "processNo": "tc" + datetime.now().strftime('%Y%m%d%H%M%S'),
            "sysCode": "APPSERVER",
            "productCode":"h5",
            "phone": "18576783787",
            "name": "梁家龙",
            "date": datetime.now().strftime('%Y-%m-%d %H:%M:%S')  # 截⽌⽇期(格式：2018-09-26 00:00:00)
        },
        "verifyMobileInfo":{
        },
        "verifyMobileInfo3C": {

        },
        "bankcardInfo4": {

        },
    },

    # 黑名单匹配request
    "blackList":{
        "reqList":[
            {
                "blacklistType":"Phone",
                "blacklistValue":"18252501238",
                "productId":"yd",
                "sysCode":"ydloan"
            },
            {
                "blacklistType":"RelativeContact",
                "blacklistValue":"18873827382",
                "productId":"yd",
                "sysCode":"ydloan"
            },
        ]
    },

    # 银联智慧request
    "union_risk":{
        "cid":"431125198806140943",         # 身份证
        "mobile":"13560720701",
        "name":"刘吉女",
        "orderId":"JQXxooYWfdw03It5ZGpt",
        "card":""                           # 银行卡号
    },
}

